package exp2;

import org.junit.Test;

import java.util.Scanner;

public class MyDoc {
    public static void main(String[] args) {
        Document a = null;
        String w = null;

        System.out.print("Enter xuehao: ");
        Scanner scan = new Scanner(System.in);

        int num = scan.nextInt();
        int num1;
        num1 = num % 6;

        switch(num1){
            case 0:
                w = "Byte";
                a = new Document(new ByteFactory());
                break;
            case 1:
                w = "Short";
                a = new Document(new ShortFactory());
                break;
            case 2:
                w = "Boolean";
                a = new Document(new BooleanFactory());
                break;
            case 3:
                w = "Long";
                a = new Document(new LongFactory());
                break;
            case 4:
                w = "Float";
                a = new Document(new FloatFactory());
                break;
            case 5:
                w = "Double";
                a = new Document(new DoubleFactory());
                break;
                default:
                    System.out.println("错误.");
        }

        System.out.println("余数为" + num1 + ",使用" + w);
        a.DisplayData();
    }
}
